﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SharePointWiki
{
    public partial class newWiki : Form
    {
        Preferences pref;
        public newWiki(Preferences _pref)
        {
            InitializeComponent();
            pref = _pref;
            load();
        }

        private void load()
        {
            lbl_wikiImagesListValue.Text = pref.cmb_wikiImageList.Text;
            lnk_wikiSiteValue.Text = pref.txt_site.Text;
            lbl_imageRootFolderValue.Text = pref.txt_wikiImageRootFolder.Text;
            Preferences.loadComboboxWithNames(cmbWikiList, pref.getWikiLists());
        }

        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pref.ShowDialog();
            load();
        }

        private void lnk_wikiSiteValue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ProcessStartInfo sInfo = new ProcessStartInfo(lnk_wikiSiteValue.Text);
            Process.Start(sInfo);
        }

    }
}
